package com.example.drug.jpa;

import java.util.List;

import com.example.common.entity.HDoctorNotice;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface HDoctorNoticeRepository extends JpaRepository<HDoctorNotice, String> {
    @Query(value = "select * from h_doctor_notice where is_top_bit = 1 order by create_time_datetime desc limit 0,1",nativeQuery = true)
    HDoctorNotice findTopOne();

    @Query(value = "select * from h_doctor_notice order by create_time_datetime desc limit ?1,?2",nativeQuery = true)
    List<HDoctorNotice> findPageOrderCreateTimeDesc(Integer skip,Integer limit);
    @Query(value = "select count(*) from h_doctor_notice ",nativeQuery = true)
    long countAll();
}
